package com.heima.admin.feign;

import com.heima.model.admin.dtos.NewsAuthDto;
import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.media.pojos.WmNews;
import com.heima.model.media.pojos.WmUser;
import com.heima.model.media.vo.WmNewsVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

@FeignClient(name = "leadnews-wemedia")
public interface WmMediaFeign {
    /**
     * 通过id查询news详情
     * @param id
     * @return
     */
    @GetMapping("/api/v1/news/one/{id}")
    public WmNews findById(@PathVariable("id") Integer id) ;

    /**
     * 更新文章的审核状态
     * @param wmNews
     * @return
     */
    @PostMapping("/api/v1/news/update_status")
    public ResponseResult updateNewsStatus(WmNews wmNews);

    /**
     * 通过wmNews的userid查询对应的WmUser
     * @param id
     * @return
     */
    @GetMapping("/api/v1/user/findById/{id}")
    public WmUser findWmUserById(@PathVariable("id") Integer id);
    @GetMapping("/api/v1/news/findRelease")
    public List<Integer> findRelease() ;
    @PostMapping("/api/v1/news/findList/")
    public PageResponseResult findList(NewsAuthDto dto);

    @GetMapping("/api/v1/news/find_news_vo/{id}")
    public WmNewsVo findWmNewsVo(@PathVariable("id") Integer id);
}
